/* 
 * File:   gametest.cpp
 * Author: dolphinigle
 *
 * Created on March 12, 2011, 10:08 PM
 */

#include <stdlib.h>
#include "gtest/gtest.h"
#include "game.hpp"
#include "direction.hpp"
#include "gameconstants.hpp"

TEST(GameTest, Harvest) {
  // TODO
}

TEST(GameTest, Left) {
  Game* g = new Game("Irvan", "test.gag");
  Direction pinitdir = g->getCreatures()->getPlayer()->getDirection();
  Cell* initcell = g->getCreatures()->getPlayer()->getCell();
  g->playerLeft();
  EXPECT_EQ(initcell, g->getCreatures()->getPlayer()->getCell());
  EXPECT_NE(pinitdir, g->getCreatures()->getPlayer()->getDirection());

}

TEST(GameTest, Right) {
  Game* g = new Game("Irvan", "test.gag");
  Direction pinitdir = g->getCreatures()->getPlayer()->getDirection();
  Cell* initcell = g->getCreatures()->getPlayer()->getCell();
  g->playerRight();
  EXPECT_EQ(initcell, g->getCreatures()->getPlayer()->getCell());
  EXPECT_NE(pinitdir, g->getCreatures()->getPlayer()->getDirection());

}

TEST(GameTest, DownUp) {
  Game* g = new Game("Irvan", "test.gag");
  Direction pinitdir = g->getCreatures()->getPlayer()->getDirection();
  Cell* initcell = g->getCreatures()->getPlayer()->getCell();
  g->playerDown();
  g->playerUp(2);
  EXPECT_NE(initcell, g->getCreatures()->getPlayer()->getCell());
  EXPECT_NE(pinitdir, g->getCreatures()->getPlayer()->getDirection());
  g->playerDown();
  g->playerUp(2);
  EXPECT_EQ(initcell, g->getCreatures()->getPlayer()->getCell());
  EXPECT_EQ(pinitdir, g->getCreatures()->getPlayer()->getDirection());
}

